package com.itheima.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.itheima.domain.db.Admin;
import com.itheima.mapper.AdminMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService
public class AdminServiceimpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;
    //根据姓名查询
    @Override
    public Admin findByUserName(String userName) {
        //创建条件
        QueryWrapper<Admin> qw = new QueryWrapper<>();
        qw.eq("userName",userName);
        Admin admin = adminMapper.selectOne(qw);
        return admin;
    }
}
